package com.yc.cloud.openai.portal.enums;


import lombok.Getter;

import java.util.Objects;

@Getter
public enum SpeechSpeaker {
    MAN("MAN", "男性"),
    WOMAN("WOMAN", "女性");
//    CHILD("CHILD", "儿童"),
//    ELDERLY("ELDERLY", "老年人"),
//    ROBOT("ROBOT", "机器人");

    private final String key;
    private final String value;

    SpeechSpeaker(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static SpeechSpeaker fromKey(String key) {
        for (SpeechSpeaker provider : SpeechSpeaker.values()) {
            if (Objects.equals(provider.getKey(), key)) {
                return provider;
            }
        }
        throw new IllegalArgumentException("Unknown provider key: " + key);
    }
}

